const mos = require('../connect');
const moment = require('moment');

const noteS = new mos.Schema({
    title:{
        type:String,
        require:true
    },
    content:{
        type:String,
        require:true
    },
    author:{
        type:String,
        require:false
    },
    time:{
        type:Date,
        require:true,
        default:()=>moment().format('YYYY-MM-DD HH:mm:ss')
    },
})

const noteModel = mos.model('notes',noteS)

module.exports = noteModel;